<ul class="nav nav-tabs">
  <li class="active"><a href="#sales" data-toggle="tab"><%= t :sales_invoices %></a></li>
  <li><a href="#purchases" data-toggle="tab"><%= t :purchases_invoices %></a></li>
</ul>

<div class="tab-content">
  <div class="tab-pane active" id="sales">
    <div class="row toolbar">
	  <div class="col-md-6">
		<span class="toolbar-header">
		  <%= t :sales_invoices %>
		</span>
	  </div>
	  <div class="col-md-6 text-right">
		<ul class="toolbar-nav">
		  <li><%= link_to feather_icon('circle-plus'), new_invoice_path %></li>
		  <li><%= link_to feather_icon('trash'), new_invoice_path %></li>
		  <li><%= link_to feather_icon('file-add'), new_invoice_path %></li>
		</ul>
		<input type="text" placeholder="Search" class="search-box" />
	  </div>
	</div>
	<table class="table table-striped">
	  <thead>
		<tr>
		  <th><%= t :actions %></th>
		  <th><%= t :code %></th>
		  <th><%= t :date_translate %></th>
		  <th>Total <%= t :fee %></th>
		  <th>Total <%= t :discount %></th>
		</tr>
	  </thead>

	  <tbody>
		<% @invoices.each do |invoice| %>
		  <tr>
			<td><%= link_to simple_icon('note'), edit_invoice_path(invoice) %> 
			<%= link_to feather_icon('trash'), invoice, method: :delete, data: { confirm: 'Are you sure?' } %></td>
			<td><%= link_to invoice.code, invoice %></td>
			<td><%= invoice.date %></td>
			<td><%= invoice.total_fee %></td>
			<td><%= invoice.total_discount %></td>
		  </tr>
		<% end %>
	  </tbody>
	</table>
  </div>
  
  <div class="tab-pane" id="purchases">
    <div class="row toolbar">
	  <div class="col-md-6">
		<span class="toolbar-header">
		  <%= t :purchases_invoices %>
		</span>
	  </div>
	  <div class="col-md-6 text-right">
		<ul class="toolbar-nav">
		  <li><%= link_to feather_icon('circle-plus'), new_invoice_path %></li>
		  <li><%= link_to feather_icon('trash'), new_invoice_path %></li>
		  <li><%= link_to feather_icon('file-add'), new_invoice_path %></li>
		</ul>
		<input type="text" placeholder="Search" class="search-box" />
	  </div>
	</div>
	<table class="table table-striped">
	  <thead>
		<tr>
		  <th><%= t :actions %></th>
		  <th><%= t :code %></th>
		  <th><%= t :date_translate %></th>
		  <th>Total <%= t :fee %></th>
		  <th>Total <%= t :discount %></th>
		</tr>
	  </thead>

	  <tbody>
		<% @invoices.each do |invoice| %>
		  <tr>
			<td><%= link_to simple_icon('note'), edit_invoice_path(invoice) %> 
			<%= link_to feather_icon('trash'), invoice, method: :delete, data: { confirm: 'Are you sure?' } %></td>
			<td><%= link_to invoice.code, invoice %></td>
			<td><%= invoice.date %></td>
			<td><%= invoice.total_fee %></td>
			<td><%= invoice.total_discount %></td>
		  </tr>
		<% end %>
	  </tbody>
	</table>
  </div>
</div>



